<div class="dux-tabs-fixed">
<ul class="uk-grid uk-grid-collapse uk-child-width-expand dux-tabs">
    <li class="{$type == 0 ? 'active' : 0}">
        <a href="{url('')}">全部</a>
    </li>
    <li class="{$type == 1 ? 'active' : ''}">
        <a href="{url('', ['type' => 1])}">待付款</a>
    </li>
    <li class="{$type == 2 ? 'active' : ''}">
        <a href="{url('', ['type' => 2])}">待发货</a>
    </li>
    <li class="{$type == 3 ? 'active' : ''}">
        <a href="{url('', ['type' => 3])}">待完成</a>
    </li>

    <li class="{$type == 4 ? 'active' : ''}">
        <a href="{url('', ['type' => 4])}">待评价</a>
    </li>
</ul>
</div>

<!--if{$pageList}-->
<div data-dux="page-ajaxPage" data-list="#list" data-tpl="#list-tpl" data-url='{url("ajax", $urlParams)}' data-page="1" data-callback="ajaxLoad">
    <div id="list">
    </div>
    <!--{else}-->
    <div class="dux-box uk-padding-small uk-text-center">
        暂无订单
    </div>
    <!--{/if}-->
</div>

<script type="text/html" id="list-tpl">
    {{# for(var i = 0; i < d.length; i++){ }}
    {{# var vo = d[i]; }}
    <div class="dux-order-list">
        <div class="list-header uk-clearfix">
            <div class="uk-float-left header-name">{{vo.order_no}}</div>
            <div class="uk-float-right header-info"><i class="fa fa-clock-o"></i>{{app.date('Y-m-d H:i:s', vo.order_create_time)}}</div>
        </div>
        <div class="list-box list-box-border">
            <div class="list-body">
                <div class="body-header dux-flex">
                    <div class="flex-1 header-name uk-text-danger">{{vo.status_data.name}}</div>
                    <div class="header-info">
                        <span class="uk-text-danger">￥{{vo.total_price}}</span>
                        {{# if(vo.delivery_price){ }}
                        <p>含运费：{{vo.delivery_price}}</p>
                        {{# } }}
                    </div>
                </div>
                <ul class="body-items">
                    {{# for(var x = 0; x < vo.order_items.length; x++){ }}
                    {{# var item = vo.order_items[x]; }}
                    <li>
                        <div class="item-img">
                            <a href="{{vo.url}}"><img src="{{item.goods_image}}"></a>
                        </div>
                        <div class="item-info">
                            <div class="title"><a href="{{vo.url}}">{{item.goods_name}}</a></div>
                            <p>数量：{{item.goods_qty}}
                                {{# if(item.goods_options.length > 0){ }}
                                {{# for(var s = 0; s < item.goods_options.length; s++){ }}
                                {{# var v = item.goods_options[s]; }}
                                {{v.name}}：{{v.value}}
                                {{# } }}
                                {{# } }}
                            </p>
                            <p>￥{{item.goods_price}}</p>
                        </div>
                    </li>
                    {{# } }}
                </ul>
            </div>
            <div class="list-footer">
                共{{vo.order_sum}}件商品
            </div>
            {{# if(vo.status_data.action){ }}
            <div class="list-action">
                	{{vo.status_data.html}}
            </div>
            {{# } }}
        </div>
    </div>
    {{# } }}
</script>

<script>
    Do('base', function () {
        window.ajaxLoad = function () {
            dux.bind('#list');
        };
    });

</script>
